<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ include file="../../Include/Config.jsp"%>
<html>
  <head>
    <title>Web Ram Program</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="ram/style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="js/jquery-1.7.1.js"></script>
    <script type="text/javascript">
      $(function(){
        <logic:messagesPresent message="true">
    	  <html:messages message="true" id="msg">
    	      var msgs = '<bean:write name="msg" />'; 
  	          msgs = msgs.replace(/\?/g, '');
  	          msgs = msgs.replace(/en_US./g, '');
  	          msgs = msgs.replace(/ko_KR./g, '');
              if(msgs.search("되었") > 0){
              	alert(msgs);
                  location.href="system-img.do";
              }
    	    </html:messages>
          </logic:messagesPresent>
          
    	  $("input[type=file]").click(function(event){
    		  if(confirm("기존의 사진은 삭제 됩니다.\n 계속 하기겠습니까?")){
    			  
    		  }else{
    			  return false;
    		  }
    	  }).change(function(){
              $("img#previewImg").hide('slow');
          });

          $("#listImg").css("cursor", "pointer").click(function(){
              location.href="system-img.do";
          });

          $("#updateImg").css("cursor", "pointer").click(function(){
              var form = $("form")[0];
              if(confirm("수정 하시겠습니까?")){
                  form.method.value="update";
                  form.submit();
              }
          }); 
          
          $("#deleteImg").css("cursor", "pointer").click(function(){
              var form = $("form")[0];
              if(confirm("삭제 하시겠습니까?")){
                  form.method.value="delete";
                  form.submit();
              }
          });
      });
    </script>
  </head>
  <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <html:form method="post" action="system-img-submit" enctype="multipart/form-data">
    <input type="hidden" name="method" value="" />
    <html:hidden name="sysimgData" property="sysimgUid" />
    <html:hidden name="sysimgData" property="sysimgFile"/>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="60">
                <!----- header ----------->
                <%@ include file="../../Include/Header.jsp"%>
                <!----- header end ----------->
              </td>
            </tr>
            <tr>
              <td>
                <div align="left">
                  <table width="1251" border="0" cellpadding="0" cellspacing="0">
                    <tr valign="top">
                      <td width="180" height="473">
                        <%@ include file="../../Include/Admin_Left.jsp"%>
                      </td>
                      <td width="20">&nbsp;</td>
                      <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td>
                              <!----<table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td height="30" align="center" bgcolor="#333333">
                                    <font color="#FFFFFF">
                                      <strong>
                                        System 이미지 상세보기
                                      </strong>
                                    </font>
                                  </td>
                                </tr>
                                <tr>
                                  <td height="1" bgcolor="f44901"></td>
                                </tr>
                                <tr>
                                  <td bgcolor="#f4f4f4">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="10">
                                      <tr>
                                        <td valign="top">
                                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                              <td height="22">
                                                <p align="right">Home&gt;Admin&gt;System 이미지관리</p>
                                              </td>
                                            </tr>
                                          </table>
                                        </td>
                                      </tr>
                                    </table>
                                  </td>
                                </tr>
                              </table>--->
							  <img src="ram/images/sysimg-view.jpg">
                            </td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>
                              <table width="780" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <!------------------------------------------ 프로그램 적용 시작 -------------------------------->
                                  <td>
                                    <table width="1050" border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td height="30" width="1050"><font color="ff3300"><b>기본정보</b></font></td>
                                      </tr>
                                      <tr>
                                        <td width="1050">
                                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                              <td bgcolor="#DDDDDD">
                                                <table width="100%" border="0" cellspacing="1" cellpadding="5" align="center">
                                                  <tr>
                                                    <td height="30" bgcolor="#f4f4f4" width="164">이미지명</td>
                                                    <td height="30" bgcolor="#FFFFFF" width="593">
                                                      <p>
                                                        <html:text name="sysimgData" property="sysimgName" styleClass="grayform" size="36" />
                                                      </p>
                                                    </td>
                                                  </tr>
                                                  <tr>
                                                    <td width="164" height="30" bgcolor="#F4F4F4">구분</td>
                                                    <td width="593" height="30" bgcolor="white">
                                                      <p>
                                                        <html:select name="sysimgData" property="sysimgGubun">
                                                          <html:option value="B">Branch</html:option>
                                                          <html:option value="E">Equipment</html:option>
                                                        </html:select>
                                                      </p>
                                                    </td>
                                                  </tr>
                                                  <tr>
                                                    <td height="30" bgcolor="#f4f4f4" width="164">이미지파일</td>
                                                    <td width="593" height="30" bgcolor="#FFFFFF">
                                                      <img alt="" id="previewImg" src="ram/Admin/System_Img/Upload/<bean:write name="sysimgData" property="sysimgFile" />">
                                                      <p>
                                                        <html:file styleId="upFile" property="upFile" styleClass="grayform" size="36" />
                                                      </p>
                                                    </td>
                                                  </tr>
                                                </table>
                                              </td>
                                            </tr>
                                          </table>
                                        </td>
                                      </tr>
                                      <tr>
                                        <td height="50" align="center" width="1050">
                                          <img id="updateImg" src="ram/images/btn_edit.jpg" border="0">
                                          <img id="listImg" src="ram/images/btn_list.jpg" border="0">
                                          <img id="deleteImg" src="ram/images/btn_delete.jpg" border="0">                                          
                                        </td>
                                      </tr>
                                      <tr>
                                        <td width="1050">&nbsp;</td>
                                      </tr>
                                    </table>
                                  </td>
                                  <!------------------------------------------ 프로그램 적용 끝 -------------------------------->
                                </tr>
                              </table></td>
                            </tr>
                            <tr>
                              <td>&nbsp;</td>
                            </tr>
                            <tr>
                              <td>&nbsp;</td>
                            </tr>
                          </table>
                          <p>&nbsp;</p>
                        </td>
                      </tr>
                    </table>
                  </div>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <%@ include file="../../Include/Foot.jsp"%>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      </html:form>
    </body>
  </html>